﻿using System.ComponentModel;
using Tetris.Game.ControlsBase.Common;

namespace Tetris.Game.ControlsBase
{
    [ToolboxItem(true)]
    [Shape(true, ShapeType.O)]
    public class OShape : TetrisShapeBase
    {
        public OShape()
        {
            this.TetrisShapeType = ShapeType.O;
            Size = this.TetrisShapeType.GetShapeDefaultSize();
            TetrisShapeColor = this.TetrisShapeType.GetShapeColor();
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
        }

        protected override void PaintBlocks(Graphics g)
        {
            int blockSize = this.Size.Width >> 1;
            BlockSize = blockSize;
            int w = blockSize << 1;
            this.Size = new Size(w, w);
            for (int i = 0; i < 2; i++)
            {
                PaintBlock(g, i * blockSize, 0, blockSize, blockSize);
            }
            for (int i = 0; i < 2; i++)
            {
                PaintBlock(g, i * blockSize, blockSize, blockSize, blockSize);
            }
        }
    }
}
